package rms.mall.server.starter.controller.system;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import rms.mall.server.api.module.Result;
import rms.mall.server.api.module.system.AcctInfoTO;
import rms.mall.server.application.service.AcctInfoService;
import rms.mall.server.domain.context.CommonContext;

import javax.annotation.Resource;

@RestController
@RequestMapping("/api/v1/acct-info")
public class AcctInfoController {


    @Resource
    private AcctInfoService acctInfoService;

    @GetMapping("/login-info")
    public Result loginInfo() {
        AcctInfoTO acctInfoTO = acctInfoService.getAcctInfoById(CommonContext.get().getAcctId());
        return Result.OK(acctInfoTO);
    }
}
